﻿using System;
using System.Collections.Generic;
using System.Data;
using System.Linq;
using System.Text;

namespace FangDuShi_API.BLL
{
    /// <summary>
    /// API逻辑类
    /// </summary>
    public class API
    {
        private DAL.API apiDAL = new DAL.API();
        /// <summary>
        /// 测试数据库连接是否成功
        /// <creator>wangl</creator>
        /// <date>2013-02-17</date>
        /// </summary>
        /// <returns>1 成功 -1 失败</returns>
        public int DBConnectTest()
        {
            return apiDAL.DBConnectTest();
        }
        public DateTime GetServerDatetime()
        {
            return apiDAL.GetServerDatetime();
        }

        /// <summary>
        /// 分页获取数据
        /// <creator>sunlj</creator>
        /// <date>2015-02-09</date>
        /// </summary>       
        /// <param name="tableName">表名</param>
        /// <param name="fields">字段名(全部字段为*)</param>
        /// <param name="pageSize">每页显示多少条记录</param>
        /// <param name="pageIndex">指定当前为第几页 </param>
        /// <param name="strWhere">条件语句(不用加where) </param>
        /// <param name="fOrderFiled">排序字段(必须!支持多字段)  </param>
        /// <param name="orderType">排序方式，非0则降序</param>
        /// <param name="total">返回总记录数</param>
        /// <returns>返回所取ds</returns>
        public DataSet GetListByPage(string tableName, string fields, int pageSize, int pageIndex, string strWhere, string fOrderFiled, int orderType, out int total)
        {
            return apiDAL.GetListByPage(tableName, fields, pageSize, pageIndex, strWhere, fOrderFiled, orderType, out total);
        }
    }
}
